home *** CD-ROM | disk | FTP | other *** search
- // Copyright (C) 1997-2002 Alias|Wavefront,
- // a division of Silicon Graphics Limited.
- //
- // The information in this file is provided for the exclusive use of the
- // licensees of Alias|Wavefront. Such users have the right to use, modify,
- // and incorporate this code into other products for purposes authorized
- // by the Alias|Wavefront license agreement, without fee.
- //
- // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- // PERFORMANCE OF THIS SOFTWARE.
- //
- // Copyright (C) 1997-1999 Alias|Wavefront,
- // a division of Silicon Graphics Limited.
- //
- // The information in this file is provided for the exclusive use of the
- // licensees of Alias|Wavefront. Such users have the right to use, modify,
- // and incorporate this code into other products for purposes authorized
- // by the Alias|Wavefront license agreement, without fee.
- //
- // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- // PERFORMANCE OF THIS SOFTWARE.
- //
- /////////////////////////////////////////////////////////////////////////
- // Alias|Wavefront Script File
- // MODIFY THIS AT YOUR OWN RISK
- //
- // Creation Date: September, 1999
- //
- //<doc>
- //<name findRelatedSkinCluster>
- //<owner "Alias|Wavefront Unsupported">
- //
- //<synopsis>
- // findRelatedSkinCluster (string $skinObj)
- //
- //<returns>
- // None
- //
- //<description>
- // Script for finding a skin cluster that deforms the specified skin.
- //
- //<examples>
- // To find the skinCluster for a skin called "johnBoy", type:
- //
- // findRelatedSkinCluster("johnBoy");
- //
- //</doc>
- /////////////////////////////////////////////////////////////////////////
- //
- global proc string findRelatedSkinCluster(string $skinObj)
- {
- string $skinShape;
- string $skinShapeWithPath;
- string $cpTest[] = `ls -type controlPoint $skinObj`;
- if (size($cpTest)) {
- $skinShape = $skinObj;
- } else {
- string $rels[] = `listRelatives $skinObj`;
- for ($r in $rels) {
- $cpTest = `ls -type controlPoint ($skinObj+"|"+$r)`;
- if (0 == size($cpTest)) {
- continue;
- }
- int $io = `getAttr ($skinObj+"|"+$r+".io")`;
- if ($io) {
- continue;
- }
- $skinShape = $r;
- $skinShapeWithPath = ($skinObj+"|"+$r);
- break;
- }
- }
-
- if (0 == size($skinShape)) {
- return "";
- }
-
- string $clusters[] = `ls -type skinCluster`;
- for ($c in $clusters) {
- string $geom[] = `skinCluster -q -g $c`;
- for ($g in $geom) {
- if ($g == $skinShape || $g == $skinShapeWithPath) {
- return $c;
- }
- }
- }
- return "";
- }
-